import Vue from 'vue'
import VueI18n from 'vue-i18n'
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'

import loginZh from './chinese/login' // 用户登录(中文)

Vue.use(VueI18n)
const messages = {
    en: {
        language: 'English',
        ...enLocale,
    },
    zh: {
        language: '简体中文',
        ...zhLocale,
        ...loginZh,
    },
}
const i18n = new VueI18n({
    locale: localStorage.getItem('languageVal') || 'zh', // 语言类型存储到localstorage里
    messages,
})
console.log(i18n)
// 导出messages 给切换语言的时候用
export { i18n, messages }
